home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
Jogos de Azar
/
fruit.swf
/
scripts
/
C_GoldCoinsMenuCLASS.as
< prev
next >
Wrap
Text File
|
2006-01-17
|
2KB
|
78 lines
_global.C_GoldCoinsMenuCLASS = function()
{
this.init();
};
C_GoldCoinsMenuCLASS.prototype = new MovieClip();
C_GoldCoinsMenuCLASS.prototype.init = function()
{
this.stop();
if(!this._coins)
{
this._coins = 1;
}
this.setCoins(this._coins);
var b;
var i = 1;
while(i <= this.max)
{
b = this["c" + i + "_btn"];
b.n = i;
b.onPress = function()
{
this._parent.setCoins(this.n);
this._parent.doOut();
};
b.onRollOver = function()
{
var o = this._parent;
var h = o.hints[this.n];
o.doOver();
if(h != undefined)
{
o.showAlt(h);
}
};
b.onDragOut = b.onRollOut = function()
{
this._parent.hideAlt();
this._parent.doOut();
};
i++;
}
var o = {};
o[1] = "Bet ONE coin";
o[2] = "Bet TWO coins";
o[3] = "Bet TREE coins";
o[4] = "Bet FOUR coins";
o[5] = "Bet FIVE coins";
this.setHints(o);
};
C_GoldCoinsMenuCLASS.prototype.setCoins = function(c)
{
if(c < 0 || c > this.max)
{
return false;
}
delete this["c" + this._coins + "_btn"].enabled;
this["c" + c + "_btn"].enabled = false;
this.gotoAndStop("coin_" + c);
this._coins = c;
this.client.client[this.client.handler](c,this);
return true;
};
C_GoldCoinsMenuCLASS.prototype.setHints = function(h)
{
this.hints = h;
};
C_GoldCoinsMenuCLASS.prototype.setChangeHandler = function(client, handler)
{
this.client = {client:client,handler:handler};
};
C_GoldCoinsMenuCLASS.prototype.addProperty("coins",function()
{
return this._coins;
}
,C_GoldCoinsMenuCLASS.prototype.setCoins);
ASSetPropFlags(_global,"C_GoldCoinsMenuCLASS",131);
Object.registerClass("C_GoldCoinsMenuCLASS",C_GoldCoinsMenuCLASS);